Mega Code Archive

Categories
1) Android
2) ASP.Net
3) ASP.Net Tutorial
4) C
5) C Tutorial
6) C#
7) C# Book
8) C# by API
9) C# Tutorial
10) C++
11) C++ Tutorial
12) Delphi
13) Flash ActionScript
14) Flex
15) Java
16) Java Book
17) Java by API
18) Java Tutorial
19) JavaScript DHTML
20) JavaScript Reference
21) JavaScript Tutorial
22) MSOfficeExcel 2007 Tutorial
23) MSOfficePowerPoint 2007 Tutorial
24) MSOfficeWord 2007 Tutorial
25) MSSQL
26) MSSQL Tutorial
27) MySQL
28) MySQL Tutorial
29) Oracle PLSQL
30) Oracle PLSQL Tutorial
31) Perl
32) Php
33) PostgreSQL
34) Python
35) Python Tutorial
36) Ruby
37) Silverlight
38) VB.Net
39) VB.Net by API
40) VB.Net Tutorial
41) Visual C++ .NET
42) VisualBasic Script
43) XML
44) XML Tutorial
 
MSSQL Tutorial
1) Aggregate Functions
2) Analytical Functions
3) CLR
4) Constraints
5) Cursor
6) Data Convert Functions
7) Data Types
8) Database
9) Date Functions
10) Index
11) Insert Delete Update
12) Math Functions
13) Procedure Function
14) Query
15) Sequence Indentity
16) Set Operations
17) String Functions
18) Subquery
19) System Functions
20) System Settings
21) System Tables Views
22) Table
23) Table Join
24) Transact SQL
25) Transaction
26) Trigger
27) User Role
28) View
29) XML
Query
1) A BETWEEN phrase preceded by NOT
2) A BETWEEN phrase with a test expression coded as a calculated value
3) A BETWEEN phrase with literal values
4) A BETWEEN phrase with the upper and lower limits coded as calculated values
5) A common use for EXISTS is to answer a query such as Show me the titles for which no stores have sales
6) A compound condition without parentheses
7) A count for each grouping rather than the full table
8) A query that returns Billings smaller than the largest Billing for Banker 115
9) A query that uses a derived table to retrieve the top 5 Bankers by average Billing total
10) A search condition that uses the AND operator
11) A search condition that uses the NOT operator
12) A search condition that uses the OR operator
13) A SELECT statement that doesnt provide a name for a calculated column
14) A SELECT statement that eliminates duplicate rows
15) A SELECT statement that retrieves rows with non-zero values
16) A SELECT statement that retrieves rows with null values
17) A SELECT statement that retrieves rows without null values
18) A SELECT statement that retrieves three columns from each row, sorted in descending sequence by Billing total
19) A SELECT statement that retrieves two columns and a calculated value for a specific Billing
20) A SELECT statement that returns all rows
21) A SELECT statement that returns an empty result set
22) A SELECT statement that uses a searchable CASE function
23) A SELECT statement that uses a simple CASE function
24) A SELECT statement that uses a subquery in the WHERE clause
25) A SELECT statement that uses parentheses to control the sequence of operations
26) A SELECT statement that uses the AS keyword (the preferred technique)
27) A SELECT statement that uses the CHAR function to format output
28) A SELECT statement that uses the modulo operator
29) A SELECT statement with a TOP clause
30) A SELECT statement with a TOP clause and the PERCENT keyword
31) A SELECT statement with a TOP clause and the WITH TIES keyword
32) A Simple CASE
33) A simple subquery using the EXISTS clause
34) A statement that creates a complete copy of the Billings table
35) A summary query that counts the number of Billings by Banker
36) A summary query that uses the DISTINCT keyword
37) A summary query with a compound condition in the HAVING clause
38) A summary query with a search condition in the HAVING clause
39) A summary query with a search condition in the WHERE clause
40) Add a WHERE clause and group by
41) Alias a column
42) Alias for case statement
43) All the operators we can use with the WHERE clause
44) An alias allows you to change the name of a column in the result set
45) An expression can also be a part of the condition in the WHERE clause
46) An IN operator is equivalent to a series of conditions, connected with one or more OR operators
47) An IN phrase preceded by NOT
48) An IN phrase with a list of numeric literals
49) An IN phrase with a subquery
50) An ORDER BY clause that sorts by one column in descending sequence
51) An ORDER BY clause that sorts by three columns
52) An ORDER BY clause that uses an alias
53) An ORDER BY clause that uses an expression
54) An ORDER BY clause that uses column positions
55) And with parenthesis
56) AND, OR without parenthesis
57) ANY and ALL Operators
58) ANY and SOME
59) Any of the wildcard characters (%, _ [, ], or ) enclosed in square brackets stand for themselves
60) Asterisk () specifies all columns of the named tables in the FROM clause
61) Automatic Code Generation for CASE Expressions
62) Bankers located in Iowa
63) Bankers with names from A to L
64) Begin with a character in the range C through F
65) Billings on or after a specified date
66) Both the EmployeeID and CustomerID columns in our GROUP BY
67) Both uppercase and lowercase statements are acceptable, a query could be written as follows
68) Calculation in where clause
69) CASE Expression
70) Case then with query
71) Case when else
72) Case with range
73) Character concatenation can be performed using the plus sign
74) Compound condition with parentheses
75) Correlated subquery using Distinct
76) Create an alias column called SubCategory
77) Creating a NULLable Column Using SELECT INTO
78) Deal with divided by 0
79) Declare variable and use it in TOP PERCENT
80) Define variable for query top percent
81) DISTINCT can be used only once in a SELECT list, and it must precede all column names in that list
82) Distinct with two columns
83) Do our sorting using numeric fields
84) Doing a calculation in a Searched CASE
85) Double the value of a column
86) ESCAPE option
87) Example Results that match the mask
88) EXISTS() returns a row in the outer query when any records are returned by a subquery
89) Extracting partial records using GROUP BY
90) Finding All Using the ANY Predicate
91) Finding the First Order for Each Customer Using the ALL Predicate
92) Finding the Last Row in Employee Using ALL
93) Finding the Most Recently Shipped Employee Using ALL
94) Finding the Most Recently Shipped Employee Using ALL with NULL Handling
95) Group by and table join
96) GROUP BY with SUM()
97) HAVING clause defines the condition that is then applied to groups of rows
98) Having and table join
99) How the ALL keyword works
100) How the ANY and SOME keywords work
101) IF EXISTS
102) In and subquery
103) IS NULL and = NULL
104) Less than SOME
105) LIKE DAMI[EO]N
106) LIKE is an operator that compares column values with a specified pattern
107) LIKE N[^K-Y]
108) NOT BETWEEN
109) NOT BETWEEN operator can be used to search for column values that do not fall within the specified range
110) NOT EXISTS with correlated subquery
111) NOT LIKE [1-9]%
112) NOT NULL constraint
113) Not or
114) Nullability
115) NULLs Sort Last
116) Operator Precedence
117) ORDER BY Clause
118) Order by not null date
119) Order criterion contains any aggregate function
120) Parenthesis with AND, OR
121) Pattern matching with upper case string
122) Retrieve specific columns
123) Searched CASE expression looks for the first expression that evaluates to true
124) SELECT (1 0 + 3 0) 4 0 -- Returns 1 00
125) SELECT 1 0 + 3 0 4 0 -- Returns 1 75
126) Selectively Query Grouped data using HAVING
127) Sorting your grouped results by an aggregate
128) Sorting your grouped results with ORDER BY clause
129) SQL Server evaluates operators in this sequence
130) Summarizing Data Using the CASE Expression
131) Summarizing Data Using the Searched CASE Expression
132) Table alias
133) The ALL operator evaluates to true if the evaluation of the table column in the inner query returns all values of that column
134) The ALL predicate is more restrictive, in that all of the values inside the subquery must satisfy the comparison condition
135) The arithmetic operators in order of precedence
136) The basic syntax of the SELECT statement
137) The BETWEEN operator is logically equal to two individual comparisons, which are connected with the Boolean operator AND
138) The BETWEEN operator searches for all values in the range inclusively
139) The character ^ specifies the negation of a range or a list of characters
140) The condition column IS NOT NULL is equivalent to the condition NOT (column IS NULL)
141) The condition column NOT LIKE pattern is equivalent to the condition NOT (column LIKE pattern)
142) The expanded syntax of the ORDER BY clause
143) The HAVING clause can also be used without aggregates
144) The IN operator can be used together with the Boolean operator NOT
145) The operators you can use in a search condition
146) The order criterion may contain more than one column
147) The same condition rephrased to eliminate the NOT operator
148) The specification column_name [as] column_heading
149) The syntax of a subquery that uses the EXISTS operator
150) The syntax of a WHERE clause that compares an expression with the value returned by a subquery
151) The syntax of a WHERE clause that uses an IN phrase with a subquery
152) The syntax of the searched CASE function
153) The syntax of the SELECT INTO statement
154) The syntax of the SELECT statement with the GROUP BY and HAVING clauses
155) The syntax of the WHERE clause with a BETWEEN phrase
156) The syntax of the WHERE clause with a LIKE phrase
157) The syntax of the WHERE clause with an IN phrase
158) The syntax of the WHERE clause with comparison operators
159) The syntax of the WHERE clause with logical operators
160) The syntax of the WHERE clause with the IS NULL clause
161) The syntax pattern for case
162) The use of the ANY operator
163) The use of the LIKE operator (together with NOT)
164) The use of the wildcard characters % and_
165) This is the query using equivalent formulation with = ANY
166) Three Boolean operations have different priorities for evaluation
167) Top Clause with the UPDATE statement
168) TOP n Clause
169) TOP n Query with ORDER BY
170) Update statement based on case condition
171) Use a comparison operator to compare any two expressions that result in like data types
172) Use AND to link two conditions
173) Use CAST function to sort during ordering
174) Use LIKE to retrieve rows that match a string pattern
175) Use local variable in a select statement
176) Use OR to link two conditions
177) Use subqueries to restrict what rows in a table will be deleted
178) Use the AND and OR logical operators to create compound conditions that consist of two or more conditions
179) Use the AND operator to specify that the search must satisfy both of the conditions
180) Use the AS keyword in some places to add column alias
181) Use the NOT operator to negate a condition
182) Use the operator (instead of !=) to remain consistent with the SQL standard
183) Use the OR operator to specify that the search must satisfy at least one of the conditions
184) Use TOP n clause with the DELETE statement
185) Use two case statements in one select statement
186) Use two variables in like function
187) Using a CASE expression to sum sales by weekday
188) Using a Table with a rowversion Column
189) Using GROUP BY ALL
190) Using INTO clause with where clause
191) Using Query Hints
192) Using SELECT DISTINCT or a GROUP BY statement in the inner query
193) Using SELECT INTO to Create an Empty Table
194) Using SELECT to Create a Script
195) Using Table Hints (WITH (NOLOCK))
196) Using the CASE Expression with Complex Conditions
197) Using the INTO Clause
198) Using the ROWGUIDCOL Property
199) Using the TABLESAMPLE to Return Random Rows
200) Using the TOP keyword with Ordered Results
201) Using Wildcards with LIKE and _
202) When the DISTINCT keyword is used, all duplicate values are eliminated before the function COUNT is applied
203) WHERE clause can contain other comparison operators, including the following
204) Where in a subquery
205) Where with subquery